home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / AboveBelow.dxr / playing cards_57_thot.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.8 KB  |  69 lines

  1. property spriteNum, row, fp
  2. global tableau, equal, currentsel, getlist, godlist, basecard
  3.  
  4. on beginSprite me
  5.   row = determinerow()
  6.   can = [#one: 40, #two: 54, #three: 68, #four: 82]
  7.   fp = can[row]
  8. end
  9.  
  10. on determinerow me
  11.   if spriteNum = 96 then
  12.     return #one
  13.   else
  14.     if spriteNum = 97 then
  15.       return #two
  16.     else
  17.       if spriteNum = 98 then
  18.         return #three
  19.       else
  20.         if spriteNum = 99 then
  21.           return #four
  22.         end if
  23.       end if
  24.     end if
  25.   end if
  26. end
  27.  
  28. on mouseEnter me
  29.   if getlist <> VOID then
  30.     if not findfound(the clickOn) then
  31.       if (tableau[row].getcardcount() > 0) and (tableau[row].getcardcount() < 14) then
  32.         if ((getlist.getlastcard().rankvalue = (tableau[row].getlastcard().rankvalue + 1)) or (getlist.getlastcard().rankvalue = (tableau[row].getlastcard().rankvalue - 1))) and (getlist.getlastcard().suit = tableau[row].getlastcard().suit) then
  33.           equal = 1
  34.           godlist = tableau[row]
  35.           currentsel = tableau[row].getlastcard().spnum + 1
  36.         else
  37.           if (((getlist.getlastcard().rank = "ace") and (tableau[row].getlastcard().rank = "king")) or ((getlist.getlastcard().rank = "king") and (tableau[row].getlastcard().rank = "ace"))) and (getlist.getlastcard().suit = tableau[row].getlastcard().suit) then
  38.             equal = 1
  39.             godlist = tableau[row]
  40.             currentsel = tableau[row].getlastcard().spnum + 1
  41.           end if
  42.         end if
  43.       else
  44.         if tableau[row].getcardcount() = 0 then
  45.           put "hate"
  46.           equal = 1
  47.           godlist = tableau[row]
  48.           currentsel = fp
  49.         end if
  50.       end if
  51.     end if
  52.   end if
  53.   put equal
  54. end
  55.  
  56. on findfound arg
  57.   if (arg >= 21) and (arg <= 28) then
  58.     return 1
  59.   else
  60.     return 0
  61.   end if
  62. end
  63.  
  64. on mouseLeave me
  65.   equal = 0
  66.   currentsel = 0
  67.   godlist = VOID
  68. end
  69.